package DesignPatern.A06_代理模式.QXB.A03普通模式;

/**
 * @Author: Du
 * @Date: 2021/7/22 9:58
 */
public class GamePlayerProxy implements IGamePlayer
{
    private IGamePlayer gamePlayer = null;
    
    public GamePlayerProxy(String name)
    {
        try
        {
            this.gamePlayer = new GamePlayer(this, name);
        } catch (Exception e)
        {
            e.printStackTrace();
        }
    }
    
    @Override
    public void login()
    {
        System.out.println("代理登录");
        this.gamePlayer.login();
    }
    
    @Override
    public void killBoss()
    {
        System.out.println("代理杀BOSS");
        this.gamePlayer.killBoss();
    }
    
    @Override
    public void update()
    {
        System.out.println("代理更新");
        this.gamePlayer.update();
    }
}
